package oving1;

import java.awt.Shape;

import scravaTurtleGraphics.STG;

public class turtle {
	
	public static void draw(Shape shape){
		STG.outline(shape);
		STG.fill(shape);
	}
	public static void firkant(int[]tall, int width, int valign, int halign, int scaling, int xavst){
		for(int i=0;i<tall.length;i++){
			int heigth=scaling*tall[i];
			Shape firkant= STG.rectangle(width, heigth, valign, halign);
			if(heigth<0){
				STG.move(heigth);
				firkant= STG.rectangle(width, -heigth, valign, halign);
				draw(firkant);
				STG.move(-heigth);
			}
			else{
				draw(firkant);
			
			}
			STG.turn(-90);
			STG.move(xavst);
			STG.turn(90);
		}
	}
	public static void main(String[] args){
		STG.up();
		int[] tall= {2,4,5,1,6,-2,-6,-3,4,2,4,6,7,-5};
		int width=12;
		int scaling=10;
		int valign=10;
		int halign =0;
		int xavst=17;
		firkant(tall, width, valign, halign, scaling,xavst);
						
	}
}
